/*     */ package com.lmpop.trade.ti_credit;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_creditInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_creditInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_credit ti_credit = new Ti_credit();
/*  26 */     ti_credit.setCredit_id(map.getString("credit_id"));
/*  27 */     ti_credit.setCust_id(map.getString("cust_id"));
/*  28 */     ti_credit.setCredit_title(map.getString("credit_title"));
/*  29 */     ti_credit.setCredit_desc(map.getString("credit_desc"));
/*  30 */     ti_credit.setStart_date(map.getString("start_date"));
/*  31 */     ti_credit.setEnd_date(map.getString("end_date"));
/*  32 */     ti_credit.setDepartment(map.getString("department"));
/*  33 */     ti_credit.setUser_id(map.getString("user_id"));
/*  34 */     ti_credit.setIn_date(map.getString("in_date"));
/*     */ 
/*  36 */     String result_code = "0";
/*     */     try {
/*  38 */       insert(dbmMgr, ti_credit);
/*     */     } catch (ApplicationException e) {
/*  40 */       e.printStackTrace();
/*  41 */       result_code = "1";
/*     */     }
/*  43 */     map.setString("result_code", result_code);
/*  44 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_credit ti_credit)
/*     */     throws ApplicationException
/*     */   {
/*  53 */     dbmMgr.update("insertTi_credit", ti_credit);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  63 */     String pkid_string = map.getString("pkid");
/*  64 */     String result_code = "0";
/*     */     try {
/*  66 */       if (!pkid_string.equals("")) {
/*  67 */         String[] pkStr = pkid_string.split("\\|");
/*  68 */         for (int i = 0; i < pkStr.length; i++) {
/*  69 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  73 */       e.printStackTrace();
/*  74 */       result_code = "1";
/*     */     }
/*  76 */     map.setString("attach_root_id", pkid_string);
/*  77 */     map.setString("attach_sign", "delete");
/*  78 */     map.setString("result_code", result_code);
/*  79 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  88 */     dbmMgr.update("deleteTi_credit", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  97 */     Ti_credit ti_credit = new Ti_credit();
/*  98 */     ti_credit.setCredit_id(map.getString("credit_id"));
/*  99 */     ti_credit.setCust_id(map.getString("cust_id"));
/* 100 */     ti_credit.setCredit_title(map.getString("credit_title"));
/* 101 */     ti_credit.setCredit_desc(map.getString("credit_desc"));
/* 102 */     ti_credit.setStart_date(map.getString("start_date"));
/* 103 */     ti_credit.setEnd_date(map.getString("end_date"));
/* 104 */     ti_credit.setDepartment(map.getString("department"));
/* 105 */     ti_credit.setUser_id(map.getString("user_id"));
/* 106 */     ti_credit.setIn_date(map.getString("in_date"));
/*     */ 
/* 108 */     String result_code = "0";
/*     */     try {
/* 110 */       update(dbmMgr, ti_credit);
/*     */     } catch (ApplicationException e) {
/* 112 */       e.printStackTrace();
/* 113 */       result_code = "1";
/*     */     }
/* 115 */     map.setString("result_code", result_code);
/* 116 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_credit ti_credit)
/*     */     throws ApplicationException
/*     */   {
/* 125 */     dbmMgr.update("updateTi_credit", ti_credit);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 135 */     Map ti_credit = (Hashtable)obj;
/* 136 */     if (start == 0)
/* 137 */       start = 0;
/*     */     else {
/* 139 */       start = (start - 1) * limit;
/*     */     }
/* 141 */     ti_credit.put("start", Integer.valueOf(start));
/* 142 */     ti_credit.put("limit", Integer.valueOf(limit));
/* 143 */     return this.queryList.getList("getListByTi_creditPage", ti_credit);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 154 */     Map ti_credit = (Hashtable)obj;
/* 155 */     List list = this.queryList.getList("getCountByObjTi_credit", ti_credit);
/* 156 */     int count = 0;
/* 157 */     if ((list != null) && (list.size() > 0)) {
/* 158 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 159 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 160 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 163 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 174 */     return this.queryList.getList("getTi_creditByPk", pk);
/*     */   }
/*     */ 
/*     */   public List getCustListByPage(Object obj, int start, int limit)
/*     */   {
/* 184 */     Map ti_credit = (Hashtable)obj;
/* 185 */     if (start == 0)
/* 186 */       start = 0;
/*     */     else {
/* 188 */       start = (start - 1) * limit;
/*     */     }
/* 190 */     ti_credit.put("start", Integer.valueOf(start));
/* 191 */     ti_credit.put("limit", Integer.valueOf(limit));
/* 192 */     return this.queryList.getList("getCustListByTi_creditPage", ti_credit);
/*     */   }
/*     */ 
/*     */   public int getCustCountByObj(Object obj)
/*     */   {
/* 204 */     Map ti_credit = (Hashtable)obj;
/* 205 */     List list = this.queryList.getList("getCustCountByObjTi_credit", ti_credit);
/* 206 */     int count = 0;
/* 207 */     if ((list != null) && (list.size() > 0)) {
/* 208 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 209 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 210 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 213 */     return count;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_credit.Ti_creditInfo
 * JD-Core Version:    0.6.0
 */